/**
 * \file HeapObject.h
 * \brief HeapObject definition class. All object allocated on the heap must inherits from this class to be managed by the memory manager
 * \author Edouard ROGE
 * \date 08 august 2012
 */

#ifndef _HEAPOBJECT_
#define _HEAPOBJECT_

#include <iostream>
#include <stdlib.h>
#include "Core/Define/Define.h"
#include "MemoryPoolManager.h"

namespace Core
{
	namespace Memory
	{
		/**
		 * \class HeapObject
		 * \brief Based class for object allocated on the heap. operators new and delete are overloaded.
		 */

		class HeapObject
		{
		public:
			/**
			 * \fn HeapObject();
			 * \brief Default constructor
			 */
			HeapObject();

			/**
			 * \fn ~HeapObject();
			 * \brief Destructor
			 */
			~HeapObject();

			/**
			 * \fn void * operator new(size_t _iSize);
			 * \param _iSize needed size to allocate memory for (*this)
			 * \return pointer to (*this)
			 * \brief operator new, allocate memory for (*this)
			 */
			void * operator new(size_t _iSize);

			/**
			 * \fn void operator delete(void * _ptr);
			 * \param _ptr pointer to free
			 * \brief operator delete, delete (*this)
			 */
			void operator delete(void * _ptr);
		};
	}
}
#endif // _HEAPOBJECT_
